package com.ruoyi.system.controller;

import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.IndsvrSunpanelSystemMonitoring;
import com.ruoyi.system.service.IIndsvrSunpanelSystemMonitoringService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 系统信息监控Controller
 * 
 * @author IndSvr
 * @date 2025-06-20
 */
@RestController
@RequestMapping("/system/IndsvrSunpanelSystemMonitoring")
public class IndsvrSunpanelSystemMonitoringController extends BaseController
{
    @Autowired
    private IIndsvrSunpanelSystemMonitoringService indsvrSunpanelSystemMonitoringService;

    /**
     * 查询系统信息监控列表
     */
    @PreAuthorize("@ss.hasPermi('system:IndsvrSunpanelSystemMonitoring:list')")
    @GetMapping("/list")
    public TableDataInfo list(IndsvrSunpanelSystemMonitoring indsvrSunpanelSystemMonitoring)
    {
        startPage();
        List<IndsvrSunpanelSystemMonitoring> list = indsvrSunpanelSystemMonitoringService.selectIndsvrSunpanelSystemMonitoringList(indsvrSunpanelSystemMonitoring);
        return getDataTable(list);
    }

    /**
     * 导出系统信息监控列表
     */
    @PreAuthorize("@ss.hasPermi('system:IndsvrSunpanelSystemMonitoring:export')")
    @Log(title = "系统信息监控", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, IndsvrSunpanelSystemMonitoring indsvrSunpanelSystemMonitoring)
    {
        List<IndsvrSunpanelSystemMonitoring> list = indsvrSunpanelSystemMonitoringService.selectIndsvrSunpanelSystemMonitoringList(indsvrSunpanelSystemMonitoring);
        ExcelUtil<IndsvrSunpanelSystemMonitoring> util = new ExcelUtil<IndsvrSunpanelSystemMonitoring>(IndsvrSunpanelSystemMonitoring.class);
        util.exportExcel(response, list, "系统信息监控数据");
    }

    /**
     * 获取系统信息监控详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:IndsvrSunpanelSystemMonitoring:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(indsvrSunpanelSystemMonitoringService.selectIndsvrSunpanelSystemMonitoringById(id));
    }

    /**
     * 新增系统信息监控
     */
    @PreAuthorize("@ss.hasPermi('system:IndsvrSunpanelSystemMonitoring:add')")
    @Log(title = "系统信息监控", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody IndsvrSunpanelSystemMonitoring indsvrSunpanelSystemMonitoring)
    {
        return toAjax(indsvrSunpanelSystemMonitoringService.insertIndsvrSunpanelSystemMonitoring(indsvrSunpanelSystemMonitoring));
    }

    /**
     * 修改系统信息监控
     */
    @PreAuthorize("@ss.hasPermi('system:IndsvrSunpanelSystemMonitoring:edit')")
    @Log(title = "系统信息监控", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody IndsvrSunpanelSystemMonitoring indsvrSunpanelSystemMonitoring)
    {
        return toAjax(indsvrSunpanelSystemMonitoringService.updateIndsvrSunpanelSystemMonitoring(indsvrSunpanelSystemMonitoring));
    }

    /**
     * 删除系统信息监控
     */
    @PreAuthorize("@ss.hasPermi('system:IndsvrSunpanelSystemMonitoring:remove')")
    @Log(title = "系统信息监控", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(indsvrSunpanelSystemMonitoringService.deleteIndsvrSunpanelSystemMonitoringByIds(ids));
    }
}
